<div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" aria-label="Close" ng-click="closeAddModal()">
        <span aria-hidden="true">×</span></button>
    <h4 class="modal-title">创建采购订单</h4>
</div>
<div class="modal-body">
    <label class="col-md-2">#</label>
    <label class="col-md-3">商品</label>
    <label class="col-md-3">单位数量</label>
    <label class="col-md-2">单位</label>
    <label class="col-md-2">操作</label>
    <div ng-repeat="item in DATA.data">
        <div class="row">
            <div class="col-md-2 form-group">
                <label>{{$index + 1}}</label>
            </div>
            <div class="col-md-3 form-group">
                <select class="form-control" ng-options="c.name for c in commodityList"
                        ng-model="item.commodity"></select>
            </div>
            <div class="col-md-3 form-group">
                <input type="number" class="form-control" ng-model="item.quantity"
                       name="item2{{$index + 1}}">
            </div>
            <div class="col-md-2 form-group">
                <label>{{item.commodity.unit}}</label>
            </div>
            <div class="col-md-2 form-group">
                <button class="btn btn-default" ng-click="delete($index)">删除</button>
            </div>
        </div>
    </div>
    <div class="row">
        <button class="btn btn-default" ng-click="add()">添加</button>
    </div>

</div>
<div class="modal-footer">
    <button type="submit" class="btn btn-primary" ng-click="createPurchaseOrder()">
        保存
    </button>
    <button type="submit" class="btn btn-default pull-right"
            ng-click="closeAddModal()">
        关闭
    </button>
</div>